<?php
	/* EclipseBB:Includes:Classes::Template (template.class.php)
	 *
	 * This file runs the core of the template engine
	 * protocol.
	 *
	 * (C) 2009 EclipseBB Group
	*/
	class Template
	{
		protected $file;
		protected $values = array();
		
		public function __construct($file) { 
			$this->file = $file; 
		}
		public function output()
		{
			if ($this->file == NULL)
			{
				die("The file name was not given!");
			}
			else if (!file_exists($this->file))
			{
				die("$this->file does not exist");
			}
			$out = file_get_contents($this->file);
		
			foreach ($this->values AS $key => $value)
				$tagToReplace = "[$key]";
				$out = str_replace($tagToReplace, $value, $output);
			}	
			return $out;
		}
	}
?>